package demo.thread;

import java.util.*;
import java.util.concurrent.*;

public class Demo8 {
    public static void main1(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(3);
        list.add(2);
        list.add(4);
        List<Integer> list1 = Collections.synchronizedList(list);
        System.out.println(list1);
        CopyOnWriteArrayList<Integer> copyOnWriteArrayList = new CopyOnWriteArrayList<>();
        CopyOnWriteArraySet<Integer> copyOnWriteArraySet = new CopyOnWriteArraySet<>();
        BlockingQueue<Integer> blockingQueue = new ArrayBlockingQueue<>(2);
        ConcurrentHashMap<String, Integer> concurrentHashMap = new ConcurrentHashMap<>();

    }

    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {

            }
        });
        thread.start();
        thread.start();
    }
}
